package com.chhuang.system.po;

import java.io.Serializable;
import com.chhuang.core.model.AbstractPersistentModel;
import com.chhuang.core.validation.ValidGroupSave;
import com.chhuang.core.validation.ValidGroupUpdate;
import com.sun.xml.bind.CycleRecoverable;
import org.springframework.format.annotation.DateTimeFormat;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.*;

/**
* ChUserRoleMap Model
* @author ChHuang
* @date Thu Mar 09 09:01:29 CST 2017
*/
public class ChUserRoleMap extends AbstractPersistentModel implements CycleRecoverable{
	private static final long serialVersionUID = -5581621159529682944L;
	@NotNull(message="{ChUserRoleMap.userRoleMapId.NotNull}",groups={ValidGroupUpdate.class})
	@Size(max=32,message="{ChUserRoleMap.userRoleMapId.Size}",groups={ValidGroupSave.class})
	private String userRoleMapId;
	public String getUserRoleMapId(){
		return userRoleMapId;
	}
	public void setUserRoleMapId(String userRoleMapId){
		this.userRoleMapId=userRoleMapId;
	}
	@Size(max=32,message="{ChUserRoleMap.userId.Size}",groups={ValidGroupSave.class})
	private String userId;
	public String getUserId(){
		return userId;
	}
	public void setUserId(String userId){
		this.userId=userId;
	}
	@Size(max=32,message="{ChUserRoleMap.roleId.Size}",groups={ValidGroupSave.class})
	private String roleId;
	public String getRoleId(){
		return roleId;
	}
	public void setRoleId(String roleId){
		this.roleId=roleId;
	}
	private Integer roleOrder;
	public Integer getRoleOrder(){
		return roleOrder;
	}
	public void setRoleOrder(Integer roleOrder){
		this.roleOrder=roleOrder;
	}
	@Override
	public Serializable getId() {
		return getUserRoleMapId();
	}
	@Override
	public void setId(Serializable id) {
		setUserRoleMapId((String)id);
	}
	@Override
	public Object onCycleDetected(Context arg0) {
		ChUserRoleMap temp=new ChUserRoleMap();
		temp.setUserRoleMapId(userRoleMapId);
		return temp;
	}
	@Override
	public String toString() {
		return "ChUserRoleMap [userRoleMapId="+userRoleMapId+",userId="+userId+",roleId="+roleId+",roleOrder="+roleOrder+"]";
	}
}